
/*
* Filename:
* Summary:	
*
* Author:
* Version:
* Finished time:
*/
#include "head.h"
#include "sendpopmenu.h"
#include "ipmsg.h"
#include "mainwindow.h"
#include "config.h"
#include "fileselection.h"

/*
*callback functions
*/
static void select_file()
{
	SelectFile(SELECTFILE);
}
static void select_directory()
{
}

/*global variables*/
GtkWidget *send_popmenu;
/*menu itemfactory*/
static GtkItemFactoryEntry menu_items[] = {
	{ "/_Sendfile", "<control>F", select_file, 0, NULL},
	{ "/_Senddirectory", "<control>D", select_directory, 0, NULL}
};


/*
* Function:
* Summary:
*
* Argument:
* 1th argument --
* 2th argument --
*
* Return:
*  
*/
void NewSendPopMenu()
{
	GtkItemFactory *item_factory;
	GtkAccelGroup *accel_group;
	gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
	accel_group = gtk_accel_group_new();    
	item_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<send>", accel_group);
	gtk_item_factory_create_items (item_factory, nmenu_items, menu_items, NULL);
	//bind accel_group to window
	gtk_window_add_accel_group (GTK_WINDOW (main_window), accel_group);
	//return the popmenu which is created before
	send_popmenu = gtk_item_factory_get_widget (item_factory, "<send>");

	printf("the send_popmenu has made\n");

}
